<html>
<head><meta charset="utf-8"><title>issue-52034-liveness-only-for-things-with-regions · t-compiler/wg-nll · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/index.html">t-compiler/wg-nll</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html">issue-52034-liveness-only-for-things-with-regions</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="129152147"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129152147" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129152147">(Jul 05 2018 at 17:38)</a>:</h4>
<p>Ok, so <span class="user-mention" data-user-id="120823">@DPC</span>, discussing <a href="https://github.com/rust-lang/rust/issues/52034" target="_blank" title="https://github.com/rust-lang/rust/issues/52034">https://github.com/rust-lang/rust/issues/52034</a> ...</p>



<a name="129152167"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129152167" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129152167">(Jul 05 2018 at 17:39)</a>:</h4>
<p>the first step I think would be to refactor liveness</p>



<a name="129152172"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129152172" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129152172">(Jul 05 2018 at 17:39)</a>:</h4>
<p>so as to introduce some indirection</p>



<a name="129152182"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129152182" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129152182">(Jul 05 2018 at 17:39)</a>:</h4>
<p>e.g., right now it is always operating over bit sets of <code>mir::Local</code> -- that is, the full range of local variables</p>



<a name="129152194"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129152194" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129152194">(Jul 05 2018 at 17:39)</a>:</h4>
<p>I would probably start by trying to refactor it (but not change anything else) to operate over a bit set of some generic type <code>N: Idx</code></p>



<a name="129152209"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129152209" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129152209">(Jul 05 2018 at 17:39)</a>:</h4>
<p>and then have a mapping fn from <code>Local -&gt; Option&lt;N&gt;</code> (for now, we would always use it with <code>N = Local</code> and the mapping would be <code>Some</code>)</p>



<a name="129152255"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129152255" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129152255">(Jul 05 2018 at 17:40)</a>:</h4>
<p>does that make sense at all?</p>



<a name="129152266"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129152266" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129152266">(Jul 05 2018 at 17:40)</a>:</h4>
<p>by liveness you mean the <code>generate</code> function?</p>



<a name="129152288"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129152288" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129152288">(Jul 05 2018 at 17:40)</a>:</h4>
<p>I mean the whole module pretty much</p>



<a name="129152292"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129152292" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129152292">(Jul 05 2018 at 17:40)</a>:</h4>
<p>ah okay</p>



<a name="129152331"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129152331" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129152331">(Jul 05 2018 at 17:41)</a>:</h4>
<p>so e.g. <a href="https://github.com/rust-lang/rust/blob/94eb1760551096363ec04e42367b6b195592dbd8/src/librustc_mir/util/liveness.rs#L55" target="_blank" title="https://github.com/rust-lang/rust/blob/94eb1760551096363ec04e42367b6b195592dbd8/src/librustc_mir/util/liveness.rs#L55"><code>LivenessResult</code></a> would be <code>struct LivenessResult&lt;N: Idx&gt;</code></p>



<a name="129152336"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129152336" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129152336">(Jul 05 2018 at 17:41)</a>:</h4>
<p>or maybe <code>V</code> (for "variable")</p>



<a name="129152337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129152337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129152337">(Jul 05 2018 at 17:41)</a>:</h4>
<p>whatever</p>



<a name="129152354"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129152354" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129152354">(Jul 05 2018 at 17:41)</a>:</h4>
<p>the field <a href="https://github.com/rust-lang/rust/blob/94eb1760551096363ec04e42367b6b195592dbd8/src/librustc_mir/util/liveness.rs#L61" target="_blank" title="https://github.com/rust-lang/rust/blob/94eb1760551096363ec04e42367b6b195592dbd8/src/librustc_mir/util/liveness.rs#L61">outs</a> would go from</p>
<div class="codehilite"><pre><span></span><span class="w"> </span><span class="k">pub</span><span class="w"> </span><span class="n">outs</span>: <span class="nc">IndexVec</span><span class="o">&lt;</span><span class="n">BasicBlock</span><span class="p">,</span><span class="w"> </span><span class="n">LocalSet</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
</pre></div>


<p>to </p>
<div class="codehilite"><pre><span></span><span class="w"> </span><span class="k">pub</span><span class="w"> </span><span class="n">outs</span>: <span class="nc">IndexVec</span><span class="o">&lt;</span><span class="n">BasicBlock</span><span class="p">,</span><span class="w"> </span><span class="n">LocalSet</span><span class="o">&lt;</span><span class="n">V</span><span class="o">&gt;&gt;</span><span class="p">,</span><span class="w"></span>
</pre></div>



<a name="129152393"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129152393" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129152393">(Jul 05 2018 at 17:42)</a>:</h4>
<p>ok got it</p>



<a name="129152403"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129152403" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129152403">(Jul 05 2018 at 17:42)</a>:</h4>
<p>ok</p>



<a name="129152444"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129152444" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129152444">(Jul 05 2018 at 17:43)</a>:</h4>
<p>the <a href="https://github.com/rust-lang/rust/blob/94eb1760551096363ec04e42367b6b195592dbd8/src/librustc_mir/util/liveness.rs#L164" target="_blank" title="https://github.com/rust-lang/rust/blob/94eb1760551096363ec04e42367b6b195592dbd8/src/librustc_mir/util/liveness.rs#L164">simulate_block</a> callback would then change from</p>
<div class="codehilite"><pre><span></span><span class="n">OP</span>: <span class="nb">FnMut</span><span class="p">(</span><span class="n">Location</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">LocalSet</span><span class="p">)</span><span class="w"></span>
</pre></div>


<p>to</p>
<div class="codehilite"><pre><span></span><span class="n">OP</span>: <span class="nb">FnMut</span><span class="p">(</span><span class="n">Location</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">LocalSet</span><span class="o">&lt;</span><span class="n">V</span><span class="o">&gt;</span><span class="p">)</span><span class="w"></span>
</pre></div>


<p>I suppose</p>



<a name="129152452"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129152452" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129152452">(Jul 05 2018 at 17:43)</a>:</h4>
<p>anyway I guess you get the idea :)</p>



<a name="129152472"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129152472" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129152472">(Jul 05 2018 at 17:43)</a>:</h4>
<p>ya i have something to start with</p>



<a name="129152543"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129152543" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129152543">(Jul 05 2018 at 17:44)</a>:</h4>
<p>let me know if other questions arise :)</p>



<a name="129152547"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129152547" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129152547">(Jul 05 2018 at 17:44)</a>:</h4>
<p>ps a tip</p>



<a name="129152559"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129152559" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129152559">(Jul 05 2018 at 17:44)</a>:</h4>
<p>for this sort of refactoring</p>



<a name="129152563"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129152563" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129152563">(Jul 05 2018 at 17:44)</a>:</h4>
<p>I strongly recommend <code>./x.py check</code></p>



<a name="129152567"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129152567" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129152567">(Jul 05 2018 at 17:44)</a>:</h4>
<p>much faster</p>



<a name="129152569"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129152569" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129152569">(Jul 05 2018 at 17:45)</a>:</h4>
<p>and this ought to be the kind of thing where</p>



<a name="129152577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129152577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129152577">(Jul 05 2018 at 17:45)</a>:</h4>
<p>as long as it compiles, it will work</p>



<a name="129152586"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129152586" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129152586">(Jul 05 2018 at 17:45)</a>:</h4>
<p>i have issues with cmake on this system.</p>



<a name="129152601"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129152601" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129152601">(Jul 05 2018 at 17:45)</a>:</h4>
<p>but i guess that doesn't matter for <code>x.py check</code></p>



<a name="129153109"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129153109" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129153109">(Jul 05 2018 at 17:55)</a>:</h4>
<p>well you do prob have to build LLVM?</p>



<a name="129153110"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129153110" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129153110">(Jul 05 2018 at 17:55)</a>:</h4>
<p>not sure</p>



<a name="129153304"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129153304" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129153304">(Jul 05 2018 at 17:58)</a>:</h4>
<p>it compiled file so i'm good <span class="emoji emoji-1f604" title="smile">:smile:</span></p>



<a name="129205569"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129205569" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129205569">(Jul 06 2018 at 14:43)</a>:</h4>
<p><span class="user-mention" data-user-id="120823">@DPC</span> how goes btw? :)</p>



<a name="129205576"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129205576" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129205576">(Jul 06 2018 at 14:43)</a>:</h4>
<p>feel free to open a [WIP] PR ...</p>



<a name="129205615"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129205615" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129205615">(Jul 06 2018 at 14:44)</a>:</h4>
<p>sorry to hound you, this is just a high priority item :)</p>



<a name="129205632"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129205632" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129205632">(Jul 06 2018 at 14:44)</a>:</h4>
<p>added the V's everywhere but i'm now stuck at someplace needing it</p>



<a name="129205634"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129205634" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129205634">(Jul 06 2018 at 14:44)</a>:</h4>
<p>ya its fine. I understand</p>



<a name="129205891"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129205891" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129205891">(Jul 06 2018 at 14:48)</a>:</h4>
<p>So  i changed <code>LivenessResult</code>to <code>LivenessResults&lt;V: Idx&gt;</code>now but i get type annotation error <a href="https://github.com/Dylan-DPC/rust/blob/9363342be956d1bf7781a3b7455d80fc5d94b1f8/src/librustc_mir/borrow_check/nll/mod.rs#L104-L103" target="_blank" title="https://github.com/Dylan-DPC/rust/blob/9363342be956d1bf7781a3b7455d80fc5d94b1f8/src/librustc_mir/borrow_check/nll/mod.rs#L104-L103">https://github.com/Dylan-DPC/rust/blob/9363342be956d1bf7781a3b7455d80fc5d94b1f8/src/librustc_mir/borrow_check/nll/mod.rs#L104-L103</a></p>



<a name="129205940"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129205940" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129205940">(Jul 06 2018 at 14:49)</a>:</h4>
<p>ah, yes, you probably need to do <code>LivenessResults::&lt;Local&gt;::new</code> or something tos tart</p>



<a name="129205946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129205946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129205946">(Jul 06 2018 at 14:49)</a>:</h4>
<p>but you also will need some kind of "conversion" fn supplied somewhere, right?</p>



<a name="129205952"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129205952" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129205952">(Jul 06 2018 at 14:50)</a>:</h4>
<p>(if you do open the PR, I can check it out locally)</p>



<a name="129207006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129207006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129207006">(Jul 06 2018 at 15:08)</a>:</h4>
<p>conversion for?</p>



<a name="129207752"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129207752" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129207752">(Jul 06 2018 at 15:22)</a>:</h4>
<p>I mean conversion from Local to <code>Option&lt;V&gt;</code></p>



<a name="129207786"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129207786" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129207786">(Jul 06 2018 at 15:23)</a>:</h4>
<p><span class="user-mention" data-user-id="120823">@DPC</span> can you send me your most recent commit or something?</p>



<a name="129207839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129207839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129207839">(Jul 06 2018 at 15:24)</a>:</h4>
<p>(or just open a <code>[WIP]</code> PR)</p>



<a name="129207843"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129207843" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129207843">(Jul 06 2018 at 15:24)</a>:</h4>
<p>yah will open a wip pr</p>



<a name="129207848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129207848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129207848">(Jul 06 2018 at 15:24)</a>:</h4>
<p>ok, it'd be easier to take a look that way</p>



<a name="129213453"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129213453" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129213453">(Jul 06 2018 at 17:12)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/pull/52115" target="_blank" title="https://github.com/rust-lang/rust/pull/52115">https://github.com/rust-lang/rust/pull/52115</a></p>



<a name="129218690"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129218690" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129218690">(Jul 06 2018 at 19:00)</a>:</h4>
<p><span class="user-mention" data-user-id="120823">@DPC</span> great! :) I had some errands to run but I'm back now</p>



<a name="129218692"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129218692" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129218692">(Jul 06 2018 at 19:00)</a>:</h4>
<p>I'll take a quick look</p>



<a name="129219285"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129219285" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129219285">(Jul 06 2018 at 19:13)</a>:</h4>
<p><span class="user-mention" data-user-id="120823">@DPC</span> <a href="https://github.com/rust-lang/rust/pull/52115#pullrequestreview-135123555" target="_blank" title="https://github.com/rust-lang/rust/pull/52115#pullrequestreview-135123555">left a review here</a>, let me know what you think</p>



<a name="129220229"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129220229" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129220229">(Jul 06 2018 at 19:30)</a>:</h4>
<p>looks good to me. The only reason i had to &lt;V&gt; most of the structs because one of the parameters needed a &lt;V&gt; which isn't needed if a &lt;Local&gt; it</p>



<a name="129221016"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129221016" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129221016">(Jul 06 2018 at 19:49)</a>:</h4>
<p>yep :)</p>



<a name="129221019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129221019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129221019">(Jul 06 2018 at 19:49)</a>:</h4>
<p>(this is just the first part, mind you, eventually some of those structs will use something other than <code>Local</code>)</p>



<a name="129221022"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129221022" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129221022">(Jul 06 2018 at 19:49)</a>:</h4>
<p>but first we should be able to get it working with an identity mapping and that's like 90% of the work</p>



<a name="129257442"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129257442" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129257442">(Jul 07 2018 at 13:39)</a>:</h4>
<p>(deleted)</p>



<a name="129257490"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129257490" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129257490">(Jul 07 2018 at 13:40)</a>:</h4>
<p>you never completed your <a href="https://github.com/rust-lang/rust/pull/52115/files#r200744975" target="_blank" title="https://github.com/rust-lang/rust/pull/52115/files#r200744975">example</a> <span class="emoji emoji-1f61b" title="stuck out tongue">:stuck_out_tongue:</span></p>



<a name="129259439"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129259439" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129259439">(Jul 07 2018 at 14:47)</a>:</h4>
<p>whoops :)</p>



<a name="129259490"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129259490" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129259490">(Jul 07 2018 at 14:48)</a>:</h4>
<p><span class="user-mention" data-user-id="120823">@DPC</span> <a href="https://github.com/rust-lang/rust/pull/52115/files#r200744975" target="_blank" title="https://github.com/rust-lang/rust/pull/52115/files#r200744975">fixed the comment</a></p>



<a name="129271596"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129271596" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129271596">(Jul 07 2018 at 20:41)</a>:</h4>
<p><span class="user-mention" data-user-id="120823">@DPC</span> did this work out any better?</p>



<a name="129271635"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129271635" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129271635">(Jul 07 2018 at 20:42)</a>:</h4>
<p>hey.. was about to ping you. having some type issues and other errors</p>



<a name="129271637"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129271637" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129271637">(Jul 07 2018 at 20:42)</a>:</h4>
<p>i have dropped &lt;V&gt; for Local in some more places</p>



<a name="129272192"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129272192" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129272192">(Jul 07 2018 at 21:01)</a>:</h4>
<p>ok, I'm gonna board flight soon but if you push a commit and errors I may be able to offer some tips :)</p>



<a name="129287988"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129287988" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129287988">(Jul 08 2018 at 07:09)</a>:</h4>
<p>I had pushed last night. You can take a look when you are free <span class="emoji emoji-1f603" title="smiley">:smiley:</span></p>



<a name="129300262"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129300262" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129300262">(Jul 08 2018 at 13:47)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I have pushed a <a href="https://github.com/rust-lang/rust/pull/52115/commits/5f4cb99fd2e3c210fe5ba90e316cb6d32c3f8a4b" target="_blank" title="https://github.com/rust-lang/rust/pull/52115/commits/5f4cb99fd2e3c210fe5ba90e316cb6d32c3f8a4b">commit</a> that uses the <code>V: LiveVariableMap</code>  instead of <code>V:Idx</code>. If this is fine, i'll change the others to reflect the same.</p>



<a name="129517207"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129517207" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129517207">(Jul 12 2018 at 05:17)</a>:</h4>
<p><span class="user-mention" data-user-id="120823">@DPC</span> argh sorry! I was on the plane and havne't had time to open a computer till just now :)</p>



<a name="129582153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129582153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129582153">(Jul 13 2018 at 05:49)</a>:</h4>
<p><span class="user-mention" data-user-id="120823">@DPC</span> <a href="https://github.com/rust-lang/rust/pull/52115#pullrequestreview-136910766" target="_blank" title="https://github.com/rust-lang/rust/pull/52115#pullrequestreview-136910766">left another round of feedback</a> — I have to run for now again :) I might be back later though</p>



<a name="129582332"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129582332" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129582332">(Jul 13 2018 at 05:55)</a>:</h4>
<p>thanks :)</p>



<a name="129586768"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129586768" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129586768">(Jul 13 2018 at 07:59)</a>:</h4>
<p>let me know if it makes sense :) the key points are:</p>
<ul>
<li>only the liveness code needs to be parameterized, I think</li>
<li>we can distinguish between the type <code>V</code> (which represents a local variable) and the map type <code>M</code></li>
</ul>



<a name="129588872"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129588872" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129588872">(Jul 13 2018 at 08:47)</a>:</h4>
<p>yeah it does. have made the changes will push in a sec</p>



<a name="129591185"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129591185" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129591185">(Jul 13 2018 at 09:43)</a>:</h4>
<p>i'm getting:</p>
<div class="codehilite"><pre><span></span>116 | impl&lt;V, M: LiveVariableMap&lt;LiveVar = V&gt;&gt; LivenessResults&lt;V&gt; {
    |         ^ unconstrained type parameter
</pre></div>



<a name="129596397"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129596397" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129596397">(Jul 13 2018 at 11:55)</a>:</h4>
<p>(<span class="user-mention" data-user-id="120823">@DPC</span> by the way, if you fix the tidy failures on your PR, Travis will be able to continue, compile and run tests and in general be very helpful :)</p>



<a name="129603731"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129603731" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129603731">(Jul 13 2018 at 14:24)</a>:</h4>
<p><span class="user-mention" data-user-id="116113">@lqd</span> Thanks. right now it is not ready and there are many changes left which make the test status of no relavance at this point.</p>



<a name="129610446"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129610446" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129610446">(Jul 13 2018 at 16:17)</a>:</h4>
<p><span class="user-mention" data-user-id="120823">@DPC</span> I think the <code>M</code> parameter just has to be moved to the methods in question</p>



<a name="129612519"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129612519" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129612519">(Jul 13 2018 at 16:53)</a>:</h4>
<p>Left a <a href="https://github.com/rust-lang/rust/pull/52115#pullrequestreview-137112191" target="_blank" title="https://github.com/rust-lang/rust/pull/52115#pullrequestreview-137112191">few more comments</a></p>



<a name="129612617"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129612617" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129612617">(Jul 13 2018 at 16:54)</a>:</h4>
<p>yah saw it</p>



<a name="129661670"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129661670" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129661670">(Jul 14 2018 at 13:19)</a>:</h4>
<p>How do I handle passing "local" or whatever to LocalSet in cases like this? <a href="https://github.com/Dylan-DPC/rust/blob/4c8605076f4f6c8d52c809d2f854ea43d520e5fd/src/librustc_mir/transform/generator.rs#L133" target="_blank" title="https://github.com/Dylan-DPC/rust/blob/4c8605076f4f6c8d52c809d2f854ea43d520e5fd/src/librustc_mir/transform/generator.rs#L133">https://github.com/Dylan-DPC/rust/blob/4c8605076f4f6c8d52c809d2f854ea43d520e5fd/src/librustc_mir/transform/generator.rs#L133</a></p>



<a name="129663829"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129663829" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129663829">(Jul 14 2018 at 14:34)</a>:</h4>
<p>that case should just remain <code>Local</code> -- I'm not sure I 100% understand</p>



<a name="129663857"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129663857" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129663857">(Jul 14 2018 at 14:34)</a>:</h4>
<p>(in particular that code is not part of MIR borrowck)</p>



<a name="129664463"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129664463" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129664463">(Jul 14 2018 at 14:57)</a>:</h4>
<p>that errors because I added the bind on the type <code>pub type LocalSet&lt;V: LiveVariableMap&gt; = IdxSetBuf&lt;V::LiveVar&gt;;</code></p>



<a name="129666272"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129666272" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129666272">(Jul 14 2018 at 15:55)</a>:</h4>
<p>I think it should be <code>pub type LocalSet&lt;V&gt; = IdxSetBuf&lt;V&gt;</code></p>



<a name="129666282"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129666282" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129666282">(Jul 14 2018 at 15:55)</a>:</h4>
<p>sorry if I said something else</p>



<a name="129666289"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129666289" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129666289">(Jul 14 2018 at 15:55)</a>:</h4>
<p>the idea would be: <code>V</code> is the type of the variable (at the moment, always <code>Local</code>, but later a new type)</p>



<a name="129666293"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129666293" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129666293">(Jul 14 2018 at 15:55)</a>:</h4>
<p>the map type <code>M</code> we will only use as the parameter to methods</p>



<a name="129671959"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129671959" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129671959">(Jul 14 2018 at 18:45)</a>:</h4>
<p>so because of IndexVec, I have to do <code>V:Idx</code> on <code>LivenessResult</code> and other places where I'm using <code>LivenessResult</code>.</p>



<a name="129672243"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129672243" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129672243">(Jul 14 2018 at 18:54)</a>:</h4>
<p>but that will mean inserting <code>&lt;V: Idx&gt;</code> everywhere which doesn't seem to be the right thing to do</p>



<a name="129686547"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129686547" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129686547">(Jul 15 2018 at 03:46)</a>:</h4>
<p>what do you mean by <em>everywhere</em>?</p>



<a name="129686554"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129686554" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129686554">(Jul 15 2018 at 03:47)</a>:</h4>
<p>it should only be necessary to add it within the liveness code, which is now generic over the type <code>V</code> of indices used to describe variables</p>



<a name="129686657"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129686657" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129686657">(Jul 15 2018 at 03:51)</a>:</h4>
<p><span class="user-mention" data-user-id="120823">@DPC</span> I've checked out your branch locally; I may have time to poke at it and show you what I mean a bit more directly, not sure :) depends how long it takes for <code>x.py check</code> to start giving me some errors</p>



<a name="129687673"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129687673" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129687673">(Jul 15 2018 at 04:33)</a>:</h4>
<p><span class="user-mention" data-user-id="120823">@DPC</span> ok I had a few minutes so I took the liberty of pushing a commit to your branch which builds. You can check it out, but the idea is that liveness is generic over the type <code>V</code>, but everything else hardcodes <code>Local</code>. The next step then would be to make the MIR code:</p>
<ul>
<li>Define a new index type <code>LocalWithRegion</code> or something like that -- that corresponds to local variables that have regions.</li>
<li>Select those local variables that have regions and create indices for them; we would basically have some kind of map (<code>LocalWithRegionMap</code>) with the ability to map back and forth. Something like this:<ul>
<li><code>IndexVec&lt;Local, Option&lt;LocalWithRegion&gt;&gt;</code> -- <code>None</code> if the local has no regions in its type, <code>Some</code> if it has regions</li>
<li><code>IndexVec&lt;LocalWithRegion, Local&gt;</code> -- for each <code>LocalWithRegion</code>, map back to the original index</li>
</ul>
</li>
<li>Create this <code>LocalWithRegionMap</code> early on -- before computing liveness etc -- and then pass it around where needed instead of <code>IdentityMap</code> (within <code>librustc_mir::borrow_check</code>, that is -- the other code that uses liveness can stay as it is)</li>
</ul>
<p>There is perhaps some cleanup that might be worthwhile but is independent:</p>
<ul>
<li>the <code>util::liveness</code> code should probably use <code>crate</code> instead of <code>pub</code></li>
<li>the type alias <code>LocalSet&lt;V&gt; = IdxSetBuf&lt;V&gt;</code> strikes me as sort of pointless (and perhaps inaccurate, since this is not always a set of <code>Local</code> values). I would probably rename it to <code>LiveVarSet</code> or else just get rid of it.</li>
</ul>



<a name="129701362"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129701362" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129701362">(Jul 15 2018 at 13:07)</a>:</h4>
<p>Thanks</p>



<a name="129701953"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129701953" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129701953">(Jul 15 2018 at 13:26)</a>:</h4>
<p><span class="user-mention" data-user-id="120823">@DPC</span> np =) hope that makes senes</p>



<a name="129744671"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129744671" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129744671">(Jul 16 2018 at 11:42)</a>:</h4>
<blockquote>
<p>Define a new index type LocalWithRegion or something like that -- that corresponds to local variables that have regions.</p>
</blockquote>
<p>Is this a type or a struct ? I couldn't find the defn of mir::Local to cross check with.</p>



<a name="129744690"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129744690" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129744690">(Jul 16 2018 at 11:43)</a>:</h4>
<p><span class="user-mention" data-user-id="120823">@DPC</span> <code>mir::Local</code> is a struct, it's just an index</p>



<a name="129744730"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129744730" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129744730">(Jul 16 2018 at 11:44)</a>:</h4>
<p><a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc/mir/struct.Local.html" target="_blank" title="https://doc.rust-lang.org/nightly/nightly-rustc/rustc/mir/struct.Local.html">https://doc.rust-lang.org/nightly/nightly-rustc/rustc/mir/struct.Local.html</a></p>



<a name="129744733"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129744733" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129744733">(Jul 16 2018 at 11:44)</a>:</h4>
<p>it is declared with <code>newtype_index!</code> which is why it is hard to find</p>



<a name="129744736"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129744736" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129744736">(Jul 16 2018 at 11:44)</a>:</h4>
<p>we really need to change that macro</p>



<a name="129744739"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129744739" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129744739">(Jul 16 2018 at 11:44)</a>:</h4>
<p>ah okay</p>



<a name="129744744"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129744744" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129744744">(Jul 16 2018 at 11:44)</a>:</h4>
<p>specifically, it's an index into the MIR's <code>local_decls</code> vector</p>



<a name="129744746"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129744746" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129744746">(Jul 16 2018 at 11:44)</a>:</h4>
<p>I do recommend searching with rustdoc incidentally</p>



<a name="129744747"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129744747" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129744747">(Jul 16 2018 at 11:45)</a>:</h4>
<p>if you can't find something especially</p>



<a name="129744752"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129744752" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129744752">(Jul 16 2018 at 11:45)</a>:</h4>
<p>will keep it in mind</p>



<a name="129746273"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129746273" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129746273">(Jul 16 2018 at 12:20)</a>:</h4>
<p><span class="user-mention" data-user-id="120823">@DPC</span> (ps, I'm around now if you have any questions)</p>



<a name="129746281"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129746281" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129746281">(Jul 16 2018 at 12:21)</a>:</h4>
<p>yeah i can see that you are online :P</p>



<a name="129746290"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129746290" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129746290">(Jul 16 2018 at 12:21)</a>:</h4>
<p>I'm just doing my PR sweep and I saw your PR so I thought you :)</p>



<a name="129748568"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129748568" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129748568">(Jul 16 2018 at 13:08)</a>:</h4>
<blockquote>
<p>Create this LocalWithRegionMap early on -- before computing liveness etc -- and then pass it around where needed instead of IdentityMap (within librustc_mir::borrow_check, that is -- the other code that uses liveness can stay as it is)</p>
</blockquote>
<p>Where exactly should I do it?</p>



<a name="129748692"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129748692" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129748692">(Jul 16 2018 at 13:10)</a>:</h4>
<p>let me look...</p>



<a name="129748717"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129748717" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129748717">(Jul 16 2018 at 13:11)</a>:</h4>
<p>probably <a href="https://github.com/rust-lang/rust/blob/3d5753fda1ee8f729da1061e931e13b043f479a5/src/librustc_mir/borrow_check/nll/mod.rs#L102" target="_blank" title="https://github.com/rust-lang/rust/blob/3d5753fda1ee8f729da1061e931e13b043f479a5/src/librustc_mir/borrow_check/nll/mod.rs#L102">around this line</a></p>



<a name="129748725"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129748725" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129748725">(Jul 16 2018 at 13:11)</a>:</h4>
<p>currently we have something like:</p>
<div class="codehilite"><pre><span></span><span class="w">    </span><span class="c1">// Run the MIR type-checker.</span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">liveness</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&amp;</span><span class="n">LivenessResults</span>::<span class="n">compute</span><span class="p">(</span><span class="n">mir</span><span class="p">);</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">constraint_sets</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">type_check</span>::<span class="n">type_check</span><span class="p">(...);</span><span class="w"></span>
</pre></div>



<a name="129748782"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129748782" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129748782">(Jul 16 2018 at 13:12)</a>:</h4>
<p>I imagine it would become something like</p>
<div class="codehilite"><pre><span></span><span class="kd">let</span><span class="w"> </span><span class="n">liveness_map</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">NllLivenessMap</span>::<span class="n">compute</span><span class="p">(</span><span class="n">mir</span><span class="p">);</span><span class="w"></span>
<span class="kd">let</span><span class="w"> </span><span class="n">liveness</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&amp;</span><span class="n">LivenessResults</span>::<span class="n">compute</span><span class="p">(</span><span class="n">mir</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">liveness_map</span><span class="p">);</span><span class="w"></span>
<span class="kd">let</span><span class="w"> </span><span class="n">constraint_sets</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">type_check</span>::<span class="n">type_check</span><span class="p">(...);</span><span class="w"></span>
</pre></div>



<a name="129748789"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129748789" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129748789">(Jul 16 2018 at 13:12)</a>:</h4>
<p>I guess you could <em>imagine</em> us taking ownership of the map and packing it up with the <code>LivenessResults</code></p>



<a name="129748797"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129748797" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129748797">(Jul 16 2018 at 13:13)</a>:</h4>
<p>but I had initially imagined it more the way I wrote it: that the liveness code talks in terms of <code>V</code> mostly</p>



<a name="129748802"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129748802" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129748802">(Jul 16 2018 at 13:13)</a>:</h4>
<p>and the caller maps it back to <code>Local</code> if they want</p>



<a name="129748813"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129748813" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129748813">(Jul 16 2018 at 13:13)</a>:</h4>
<p>anyway minor nit, that's the place for it</p>



<a name="129748868"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129748868" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129748868">(Jul 16 2018 at 13:14)</a>:</h4>
<p>point is that the <code>type_check</code> will also need this map -- either given to it as an extra parameter (it certainly has enough now) or else packaged up in the <code>liveness</code> variable</p>



<a name="129748880"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129748880" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129748880">(Jul 16 2018 at 13:14)</a>:</h4>
<p>(is it clear what this <code>NllLivenessMap</code> is and how it would work?)</p>



<a name="129749498"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129749498" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129749498">(Jul 16 2018 at 13:26)</a>:</h4>
<p>not really</p>



<a name="129749640"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129749640" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129749640">(Jul 16 2018 at 13:29)</a>:</h4>
<p><span class="user-mention" data-user-id="120823">@DPC</span> ok so that is kind of the whole part of this PR :)</p>



<a name="129749717"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129749717" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129749717">(Jul 16 2018 at 13:30)</a>:</h4>
<p>right now, in MIR, we have a list of variables, and each one has a type. So it might be like:</p>
<div class="codehilite"><pre><span></span>_0: u32
_1: Vec&lt;&amp;&#39;x u32&gt;
...
</pre></div>



<a name="129749725"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129749725" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129749725">(Jul 16 2018 at 13:30)</a>:</h4>
<p>these indices (<code>_0</code>, <code>_1</code>) are the <code>Local</code> values</p>



<a name="129749731"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129749731" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129749731">(Jul 16 2018 at 13:30)</a>:</h4>
<p>today, we compute liveness as a sets of these local values</p>



<a name="129749742"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129749742" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129749742">(Jul 16 2018 at 13:30)</a>:</h4>
<p>so e.g. we might have -- at some basic block -- that <code>_0</code> and <code>_1</code> are both live</p>



<a name="129749756"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129749756" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129749756">(Jul 16 2018 at 13:31)</a>:</h4>
<p>problem is -- in NLL, at least -- we don't really <em>care</em> whether <code>_0</code> is live, because its type has no regions in it</p>



<a name="129749757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129749757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129749757">(Jul 16 2018 at 13:31)</a>:</h4>
<p>we <em>do</em> care about <code>_1</code> though</p>



<a name="129749764"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129749764" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129749764">(Jul 16 2018 at 13:31)</a>:</h4>
<p>(with me so far?)</p>



<a name="129749768"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129749768" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129749768">(Jul 16 2018 at 13:31)</a>:</h4>
<p>ah okay got it now</p>



<a name="129749777"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129749777" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129749777">(Jul 16 2018 at 13:31)</a>:</h4>
<p>so the idea is to map these <code>Local</code> values to a smaller set of integers</p>



<a name="129749780"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129749780" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129749780">(Jul 16 2018 at 13:31)</a>:</h4>
<p>containing just the ones with regions</p>



<a name="129749832"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129749832" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129749832">(Jul 16 2018 at 13:32)</a>:</h4>
<p>so let's call that set <code>RV0</code>, <code>RV1</code>, etc</p>



<a name="129749836"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129749836" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129749836">(Jul 16 2018 at 13:32)</a>:</h4>
<p>in that case, <code>_0</code> maps to <code>None</code></p>



<a name="129749842"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129749842" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129749842">(Jul 16 2018 at 13:32)</a>:</h4>
<p>but <code>_1</code> might map to <code>Some(RV0)</code></p>



<a name="129749849"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129749849" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129749849">(Jul 16 2018 at 13:32)</a>:</h4>
<p>(because it's the first <code>Local</code> that contains regions in its type)</p>



<a name="129749851"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129749851" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129749851">(Jul 16 2018 at 13:32)</a>:</h4>
<p>got it. The "liveness" part in the name threw me off</p>



<a name="129749859"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129749859" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129749859">(Jul 16 2018 at 13:32)</a>:</h4>
<p>ah I see yes</p>



<a name="129749865"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129749865" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129749865">(Jul 16 2018 at 13:32)</a>:</h4>
<p>anyway, <em>then</em> we can compute liveness just over the RV values</p>



<a name="129749884"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129749884" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129749884">(Jul 16 2018 at 13:33)</a>:</h4>
<p>(and map back to the original <code>Local</code> indices as needed)</p>



<a name="129749888"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129749888" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129749888">(Jul 16 2018 at 13:33)</a>:</h4>
<p>/me stops explaining</p>



<a name="129749976"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129749976" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129749976">(Jul 16 2018 at 13:35)</a>:</h4>
<p>got it. thanks</p>



<a name="129767210"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129767210" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129767210">(Jul 16 2018 at 18:22)</a>:</h4>
<p>hey.. so what will be the contents of <code>NllLivenessMap</code>? currently I have : </p>
<div class="codehilite"><pre><span></span>pub(crate) struct NllLivenessMap {
    pub liveness: IndexVec&lt;LocalWithRegion, LocalDecl&gt;,

}
</pre></div>


<p>is this correct? (have to add the lifetime) <span class="user-mention" data-user-id="116009">@nikomatsakis</span></p>



<a name="129767650"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129767650" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129767650">(Jul 16 2018 at 18:30)</a>:</h4>
<p><span class="user-mention" data-user-id="120823">@DPC</span> that doesn't look quite right</p>



<a name="129767659"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129767659" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129767659">(Jul 16 2018 at 18:30)</a>:</h4>
<p>for one thing, we want to map indices to indices</p>



<a name="129767663"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129767663" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129767663">(Jul 16 2018 at 18:30)</a>:</h4>
<p>so e.g., <code>IndexVec&lt;LocalWithRegion, Local&gt;</code></p>



<a name="129767667"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129767667" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129767667">(Jul 16 2018 at 18:31)</a>:</h4>
<p>ah so &lt;LocalWithRegion, Local&gt; ?</p>



<a name="129767668"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129767668" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129767668">(Jul 16 2018 at 18:31)</a>:</h4>
<p>but I think you also want a reverse map</p>



<a name="129767669"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129767669" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129767669">(Jul 16 2018 at 18:31)</a>:</h4>
<p>ah okay</p>



<a name="129767671"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129767671" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129767671">(Jul 16 2018 at 18:31)</a>:</h4>
<p>so probably this:</p>



<a name="129767695"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129767695" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129767695">(Jul 16 2018 at 18:31)</a>:</h4>
<p>i thought we were mapping it to the region from the <code>Local</code></p>



<a name="129767704"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129767704" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129767704">(Jul 16 2018 at 18:31)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="k">crate</span><span class="w"> </span><span class="k">struct</span> <span class="nc">NllLivenessMap</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="n">from_local</span>: <span class="nc">IndexVec</span><span class="o">&lt;</span><span class="n">Local</span><span class="p">,</span><span class="w"> </span><span class="nb">Option</span><span class="o">&lt;</span><span class="n">LocalWithRegion</span><span class="o">&gt;&gt;</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="n">to_local</span>: <span class="nc">IndexVec</span><span class="o">&lt;</span><span class="n">LocalWithRegion</span><span class="p">,</span><span class="w"> </span><span class="n">LocalDecl</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>



<a name="129767761"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129767761" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129767761">(Jul 16 2018 at 18:32)</a>:</h4>
<p>also, I think you will want to declare <code>LocalWithRegion</code> with <code>newtype_index!</code> (in case I didn't mention that before)</p>



<a name="129767768"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129767768" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129767768">(Jul 16 2018 at 18:32)</a>:</h4>
<p>yeah I've done it already</p>



<a name="129768279"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129768279" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129768279">(Jul 16 2018 at 18:43)</a>:</h4>
<p>so <code>NllLivenessMap::compute(...)</code> returns <code>NllLivenesMap</code>? and should that impl <code>LiveVariableMap&lt;LiveVar = V&gt;</code>  ?</p>



<a name="129768372"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129768372" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129768372">(Jul 16 2018 at 18:45)</a>:</h4>
<p>yes, except in this case <code>V</code> is <code>LocalWithRegion</code></p>



<a name="129768383"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129768383" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129768383">(Jul 16 2018 at 18:45)</a>:</h4>
<p>that is, it should impl <code>LiveVariableMap&lt;LiveVar = LocalWithRegion&gt;</code></p>



<a name="129768389"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129768389" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129768389">(Jul 16 2018 at 18:45)</a>:</h4>
<p>and I would expect <code>compute</code> to be something roughly like this:</p>



<a name="129768472"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129768472" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129768472">(Jul 16 2018 at 18:46)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="k">fn</span> <span class="nf">compute</span><span class="p">(</span><span class="n">mir</span>: <span class="kp">&amp;</span><span class="nc">Mir</span><span class="o">&lt;</span><span class="na">&#39;tcx</span><span class="o">&gt;</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nc">Self</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">  </span><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">to_local</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">IndexVec</span>::<span class="n">default</span><span class="p">();</span><span class="w"></span>
<span class="w">  </span><span class="kd">let</span><span class="w"> </span><span class="n">from_local</span>: <span class="nc">IndexVec</span><span class="o">&lt;</span><span class="n">_</span><span class="p">,</span><span class="w"> </span><span class="n">_</span><span class="o">&gt;</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">mir</span><span class="p">.</span><span class="n">local_decls</span><span class="p">.</span><span class="n">iter_enumerated</span><span class="p">.</span><span class="n">map</span><span class="p">(</span><span class="o">|</span><span class="n">local</span><span class="p">,</span><span class="w"> </span><span class="n">local_decl</span><span class="o">|</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">if</span><span class="w"> </span><span class="n">local_decl</span><span class="p">.</span><span class="n">ty</span><span class="p">.</span><span class="n">has_free_regions</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nb">Some</span><span class="p">(</span><span class="n">to_local</span><span class="p">.</span><span class="n">push</span><span class="p">(</span><span class="n">local</span><span class="p">))</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nb">None</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="w">  </span><span class="p">}).</span><span class="n">collect</span><span class="p">();</span><span class="w"></span>
<span class="w">  </span><span class="n">Self</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">from_local</span><span class="p">,</span><span class="w"> </span><span class="n">to_local</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>



<a name="129768531"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129768531" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129768531">(Jul 16 2018 at 18:47)</a>:</h4>
<p>one question is how to concisely check whether the type of the local decl has free regions...</p>



<a name="129768538"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129768538" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129768538">(Jul 16 2018 at 18:47)</a>:</h4>
<p>there should be some helper for that</p>



<a name="129768542"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129768542" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129768542">(Jul 16 2018 at 18:47)</a>:</h4>
<p><span class="user-mention" data-user-id="116113">@lqd</span> did a recent PR, let me remember what we did there...</p>



<a name="129768596"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129768596" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129768596">(Jul 16 2018 at 18:48)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/pull/52037" target="_blank" title="https://github.com/rust-lang/rust/pull/52037">https://github.com/rust-lang/rust/pull/52037</a></p>



<a name="129768623"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129768623" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129768623">(Jul 16 2018 at 18:49)</a>:</h4>
<p><code>ty.flags.intersects(TypeFlags::HAS_FREE_REGIONS)</code></p>



<a name="129768654"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129768654" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129768654">(Jul 16 2018 at 18:49)</a>:</h4>
<p>anyway, the key idea is that we create a <code>LocalWithRegion</code> index for each local variable that has regions in its type...</p>



<a name="129809848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129809848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129809848">(Jul 17 2018 at 12:26)</a>:</h4>
<p><span class="user-mention" data-user-id="120823">@DPC</span> were you able to make any further progress here btw?</p>



<a name="129809855"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129809855" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129809855">(Jul 17 2018 at 12:27)</a>:</h4>
<p>yeah i'm working on it</p>



<a name="129815881"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129815881" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129815881">(Jul 17 2018 at 14:31)</a>:</h4>
<p>so i'm assuming i have to write <code>has_free_regions()</code> in Ty which checks <code>ty.flags.intersects(TypeFlags::HAS_FREE_REGIONS)</code>?</p>



<a name="129815988"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129815988" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129815988">(Jul 17 2018 at 14:33)</a>:</h4>
<p>you don't have to make the method, you can just insert the code as is</p>



<a name="129815991"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129815991" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129815991">(Jul 17 2018 at 14:33)</a>:</h4>
<p>though a helper seems nice</p>



<a name="129815994"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129815994" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129815994">(Jul 17 2018 at 14:33)</a>:</h4>
<p>there is actually probably a method like this</p>



<a name="129816045"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129816045" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129816045">(Jul 17 2018 at 14:34)</a>:</h4>
<p>so, if you import the <code>use rustc::ty::TypeFoldable</code> trait</p>



<a name="129816053"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129816053" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129816053">(Jul 17 2018 at 14:34)</a>:</h4>
<p>you could use <code>has_free_regions</code></p>



<a name="129816083"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129816083" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129816083">(Jul 17 2018 at 14:34)</a>:</h4>
<p>it's a bit "indirect" but ought to compile down to the same thing</p>



<a name="129816088"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129816088" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129816088">(Jul 17 2018 at 14:34)</a>:</h4>
<p>if LLVM inlines enough :)</p>



<a name="129824809"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129824809" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129824809">(Jul 17 2018 at 17:40)</a>:</h4>
<p>how do we handle the trait LiveVariableMap for NllLivenessMap?</p>



<a name="129824835"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129824835" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129824835">(Jul 17 2018 at 17:40)</a>:</h4>
<div class="codehilite"><pre><span></span>impl LiveVariableMap for NllLivenessMap {
    type LiveVar = LocalWithRegion;

    fn from_local(&amp;self, local: Local) -&gt; Option&lt;Self::LiveVar&gt; {
    }

    fn from_live_var(&amp;self, local: Self::LiveVar) -&gt; Local {
    }

    fn num_variables(&amp;self) -&gt; usize {

    }
</pre></div>



<a name="129826131"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129826131" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129826131">(Jul 17 2018 at 18:04)</a>:</h4>
<p><span class="user-mention" data-user-id="120823">@DPC</span> well</p>



<a name="129826143"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129826143" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129826143">(Jul 17 2018 at 18:05)</a>:</h4>
<p>what is your def'n of <code>NllLivenessMap</code>? :)</p>



<a name="129826153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129826153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129826153">(Jul 17 2018 at 18:05)</a>:</h4>
<p>if it is roughly the one I gave, then something like:</p>



<a name="129826169"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129826169" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129826169">(Jul 17 2018 at 18:05)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="k">impl</span><span class="w"> </span><span class="n">LiveVariableMap</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">NllLivenessMap</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">type</span> <span class="nc">LiveVar</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">LocalWithRegion</span><span class="p">;</span><span class="w"></span>

<span class="w">    </span><span class="k">fn</span> <span class="nf">from_local</span><span class="p">(</span><span class="o">&amp;</span><span class="bp">self</span><span class="p">,</span><span class="w"> </span><span class="n">local</span>: <span class="nc">Local</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nb">Option</span><span class="o">&lt;</span><span class="n">Self</span>::<span class="n">LiveVar</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="bp">self</span><span class="p">.</span><span class="n">from_local</span><span class="p">[</span><span class="n">local</span><span class="p">]</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>

<span class="w">    </span><span class="k">fn</span> <span class="nf">from_live_var</span><span class="p">(</span><span class="o">&amp;</span><span class="bp">self</span><span class="p">,</span><span class="w"> </span><span class="n">local</span>: <span class="nc">Self</span>::<span class="n">LiveVar</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nc">Local</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="bp">self</span><span class="p">.</span><span class="n">to_local</span><span class="p">[</span><span class="n">local</span><span class="p">]</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>

<span class="w">    </span><span class="k">fn</span> <span class="nf">num_variables</span><span class="p">(</span><span class="o">&amp;</span><span class="bp">self</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="kt">usize</span> <span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="bp">self</span><span class="p">.</span><span class="n">to_local</span><span class="p">.</span><span class="n">len</span><span class="p">()</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>



<a name="129826184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129826184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129826184">(Jul 17 2018 at 18:06)</a>:</h4>
<p>ah uhmm</p>



<a name="129827896"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129827896" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129827896">(Jul 17 2018 at 18:38)</a>:</h4>
<p>can i change <a href="https://github.com/Dylan-DPC/rust/blob/8ac931dc7e58284a6165155b3802d7e52295b5a4/src/librustc_mir/borrow_check/nll/mod.rs#L205" target="_blank" title="https://github.com/Dylan-DPC/rust/blob/8ac931dc7e58284a6165155b3802d7e52295b5a4/src/librustc_mir/borrow_check/nll/mod.rs#L205">dump_mir_results</a> to accept a <code>&amp;LivenessResult&lt;LocalWithRegion&gt;</code> instead of <code>&amp;LivenessResult&lt;Local&gt;</code>?</p>



<a name="129828085"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129828085" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129828085">(Jul 17 2018 at 18:42)</a>:</h4>
<p><span class="user-mention" data-user-id="120823">@DPC</span> yes</p>



<a name="129829064"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129829064" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129829064">(Jul 17 2018 at 19:01)</a>:</h4>
<p>just have to settle some type (Local / LocalWithRegion) issues which i'll complete tomorrow <span class="emoji emoji-1f604" title="smile">:smile:</span></p>



<a name="129829483"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129829483" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129829483">(Jul 17 2018 at 19:11)</a>:</h4>
<p>awesome!</p>



<a name="129869602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129869602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129869602">(Jul 18 2018 at 12:52)</a>:</h4>
<p>hey. how to make <code> let decl = &amp;self.local_decls[local];</code> return a <code>LocalWithRegion</code> instead of <code>Local</code>?</p>



<a name="129872383"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129872383" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129872383">(Jul 18 2018 at 13:47)</a>:</h4>
<p>ah solved it</p>



<a name="129872992"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129872992" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129872992">(Jul 18 2018 at 13:58)</a>:</h4>
<p>sorry, was afk, back now</p>



<a name="129878429"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129878429" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129878429">(Jul 18 2018 at 15:30)</a>:</h4>
<p>how to resolve this? </p>
<div class="codehilite"><pre><span></span>error[E0308]: mismatched types
   --&gt; librustc/mir/visit.rs:379:42
    |
379 |                         self.visit_local(local, PlaceContext::StorageDead, location);
    |                                          ^^^^^ expected struct `mir::LocalWithRegion`, found struct `mir::Local`
...
819 | make_mir_visitor!(Visitor,);
    | ---------------------------- in this macro invocation
    |
    = note: expected type `&amp;mir::LocalWithRegion`
               found type `&amp;mir::Local`
</pre></div>



<a name="129880727"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129880727" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129880727">(Jul 18 2018 at 16:11)</a>:</h4>
<p><span class="user-mention" data-user-id="120823">@DPC</span> can you push your latest diffs?</p>



<a name="129880734"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129880734" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129880734">(Jul 18 2018 at 16:11)</a>:</h4>
<p>that error looks like you changed something you shouldn't have changed :)</p>



<a name="129883296"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129883296" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129883296">(Jul 18 2018 at 17:04)</a>:</h4>
<p>done</p>



<a name="129883971"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129883971" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129883971">(Jul 18 2018 at 17:14)</a>:</h4>
<p>pushed to your PR?</p>



<a name="129884104"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129884104" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129884104">(Jul 18 2018 at 17:16)</a>:</h4>
<p>yep <a href="https://github.com/rust-lang/rust/pull/52115/commits/b7fb2a17d63504da86dcc17154b92d8452388503" target="_blank" title="https://github.com/rust-lang/rust/pull/52115/commits/b7fb2a17d63504da86dcc17154b92d8452388503">commit</a></p>



<a name="129884262"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129884262" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129884262">(Jul 18 2018 at 17:18)</a>:</h4>
<p>ok -- the tl;dr is that you should not be modifying <code>librustc/mir/mod.rs</code> at all</p>



<a name="129884269"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129884269" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129884269">(Jul 18 2018 at 17:18)</a>:</h4>
<p><code>Local</code> remains the type for a local variable index</p>



<a name="129884279"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129884279" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129884279">(Jul 18 2018 at 17:18)</a>:</h4>
<p><code>LocalWithRegion</code> is a secondary index used only during NLL computation</p>



<a name="129884310"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129884310" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129884310">(Jul 18 2018 at 17:19)</a>:</h4>
<p>ah thought so</p>



<a name="129888952"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129888952" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129888952">(Jul 18 2018 at 18:39)</a>:</h4>
<p>Any clues how to resolve this?</p>
<div class="codehilite"><pre><span></span>error[E0271]: type mismatch resolving `&lt;util::liveness::IdentityMap&lt;&#39;_, &#39;_&gt; as util::liveness::LiveVariableMap&gt;::LiveVar == rustc::mir::LocalWithRegion`
   --&gt; librustc_mir/borrow_check/nll/mod.rs:240:18
    |
240 |                 .simulate_block(&amp;mir, bb, map, |location, local_set| {
    |                  ^^^^^^^^^^^^^^ expected struct `rustc::mir::Local`, found struct `rustc::mir::LocalWithRegion`
    |
    = note: expected type `rustc::mir::Local`
               found type `rustc::mir::LocalWithRegion`
</pre></div>



<a name="129889112"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129889112" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129889112">(Jul 18 2018 at 18:42)</a>:</h4>
<p><span class="user-mention" data-user-id="120823">@DPC</span> latest diffs pushed?</p>



<a name="129889117"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129889117" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129889117">(Jul 18 2018 at 18:42)</a>:</h4>
<p>not yet</p>



<a name="129889275"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129889275" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129889275">(Jul 18 2018 at 18:45)</a>:</h4>
<p>would be helpful :)</p>



<a name="129889302"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129889302" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129889302">(Jul 18 2018 at 18:45)</a>:</h4>
<p>sounds like though you have <code>LivenessResults&lt;Local&gt;</code> but you want <code>LivenessResults&lt;LocalWithRegion&gt;</code></p>



<a name="129889360"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129889360" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129889360">(Jul 18 2018 at 18:46)</a>:</h4>
<p>pushed</p>



<a name="129889420"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129889420" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129889420">(Jul 18 2018 at 18:47)</a>:</h4>
<p><span class="user-mention" data-user-id="120823">@DPC</span> <a href="https://github.com/rust-lang/rust/pull/52115/files#r203489774" target="_blank" title="https://github.com/rust-lang/rust/pull/52115/files#r203489774">https://github.com/rust-lang/rust/pull/52115/files#r203489774</a></p>



<a name="129928081"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129928081" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129928081">(Jul 19 2018 at 11:52)</a>:</h4>
<p>How to solve </p>
<div class="codehilite"><pre><span></span>error[E0308]: mismatched types
  --&gt; librustc_mir/borrow_check/nll/type_check/liveness.rs:91:62
   |
91 |                     let live_local_ty = self.mir.local_decls[live_local].ty;
   |                                                              ^^^^^^^^^^ expected struct `rustc::mir::Local`, found struct `rustc::mir::LocalWithRegion`
   |
   = note: expected type `rustc::mir::Local`
              found type `rustc::mir::LocalWithRegion`
</pre></div>



<a name="129928415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129928415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129928415">(Jul 19 2018 at 12:01)</a>:</h4>
<p>you'll need to translate that back to a <code>Local</code> using the map</p>



<a name="129928419"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129928419" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129928419">(Jul 19 2018 at 12:01)</a>:</h4>
<p>that is, translate <code>live_local</code> back</p>



<a name="129928461"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129928461" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129928461">(Jul 19 2018 at 12:02)</a>:</h4>
<p>ah okay</p>



<a name="129938268"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129938268" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129938268">(Jul 19 2018 at 15:25)</a>:</h4>
<p>good news <span class="emoji emoji-1f389" title="tada">:tada:</span></p>



<a name="129938270"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129938270" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129938270">(Jul 19 2018 at 15:25)</a>:</h4>
<p>it compiled without error <span class="emoji emoji-1f389" title="tada">:tada:</span></p>



<a name="129938274"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129938274" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129938274">(Jul 19 2018 at 15:25)</a>:</h4>
<p>pushing right now</p>



<a name="129939033"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129939033" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129939033">(Jul 19 2018 at 15:41)</a>:</h4>
<p>need to merge some conflicts and going off .. will push after an hour</p>



<a name="129940570"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129940570" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129940570">(Jul 19 2018 at 16:11)</a>:</h4>
<p><span class="user-mention" data-user-id="120823">@DPC</span> awesome!</p>



<a name="129946630"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129946630" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129946630">(Jul 19 2018 at 18:05)</a>:</h4>
<p>any update? :)</p>



<a name="129946862"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129946862" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129946862">(Jul 19 2018 at 18:08)</a>:</h4>
<p>pushing rn</p>



<a name="129947981"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129947981" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129947981">(Jul 19 2018 at 18:30)</a>:</h4>
<p>done</p>



<a name="129948599"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129948599" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129948599">(Jul 19 2018 at 18:43)</a>:</h4>
<p><span class="user-mention" data-user-id="120823">@DPC</span> </p>
<div class="codehilite"><pre><span></span>tidy check
[00:03:46] tidy error: /checkout/src/librustc_mir/borrow_check/nll/mod.rs:411: line longer than 100 chars
[00:03:46] tidy error: /checkout/src/librustc_mir/util/liveness.rs:573: line longer than 100 chars
[00:03:46] tidy error: /checkout/src/librustc/mir/mod.rs: missing trailing newline
[00:03:47] some tidy checks failed
</pre></div>



<a name="129948950"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129948950" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129948950">(Jul 19 2018 at 18:48)</a>:</h4>
<p><span class="user-mention" data-user-id="120823">@DPC</span> did you run tests locally at all? Looks great! I left a small nit</p>



<a name="129948960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129948960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129948960">(Jul 19 2018 at 18:48)</a>:</h4>
<p>yeah i ran <code>x.py check</code>.</p>



<a name="129948991"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129948991" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129948991">(Jul 19 2018 at 18:49)</a>:</h4>
<p>that just checks that it builds, I meant did you run e.g. <code>x.py test --stage 1 src/test/ui</code> or something like it</p>



<a name="129948996"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129948996" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129948996">(Jul 19 2018 at 18:49)</a>:</h4>
<p>not a big deal, as travis will do it ;)</p>



<a name="129949002"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129949002" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129949002">(Jul 19 2018 at 18:49)</a>:</h4>
<p>(but only once you fix the tidy errors)</p>



<a name="129949006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129949006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129949006">(Jul 19 2018 at 18:49)</a>:</h4>
<p>I was hoping to do a try run soon to measure the impact</p>



<a name="129949015"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129949015" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129949015">(Jul 19 2018 at 18:49)</a>:</h4>
<p>ah no i didn't run the test part yet</p>



<a name="129949491"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129949491" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129949491">(Jul 19 2018 at 18:57)</a>:</h4>
<p>i usually just depend on travis for that xD</p>



<a name="129949994"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129949994" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129949994">(Jul 19 2018 at 19:06)</a>:</h4>
<p>pushed the tidy part. Will push the nitbits tomorrow in the morning (you'll get them by the time you wake up )</p>



<a name="129975509"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129975509" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129975509">(Jul 20 2018 at 04:47)</a>:</h4>
<p><span class="user-mention" data-user-id="120823">@DPC</span> I tried your branch locally and saw the problem, it was a 1-line fix so I pushed it</p>



<a name="129975510"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129975510" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129975510">(Jul 20 2018 at 04:47)</a>:</h4>
<p>tests pass now</p>



<a name="129975514"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129975514" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129975514">(Jul 20 2018 at 04:47)</a>:</h4>
<p>we were still using <code>mir.local_decls.len()</code> to get the number of live vars in one point</p>



<a name="129975530"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/129975530" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#129975530">(Jul 20 2018 at 04:48)</a>:</h4>
<p>when we really out to be using <code>map.num_variables()</code></p>



<a name="130045932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130045932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130045932">(Jul 21 2018 at 08:55)</a>:</h4>
<p>perf results are available =)</p>



<a name="130045977"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130045977" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130045977">(Jul 21 2018 at 08:56)</a>:</h4>
<p>er, I meant to say: there is one small change needed (delete some outdated tests, I think) before we can land this PR</p>



<a name="130045984"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130045984" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130045984">(Jul 21 2018 at 08:56)</a>:</h4>
<p>ya i removed the liveness-* tests from mir-opt</p>



<a name="130045988"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130045988" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130045988">(Jul 21 2018 at 08:56)</a>:</h4>
<p>oh, nice</p>



<a name="130045993"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130045993" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130045993">(Jul 21 2018 at 08:56)</a>:</h4>
<p>still more failures</p>



<a name="130045994"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130045994" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130045994">(Jul 21 2018 at 08:57)</a>:</h4>
<p>I guess we have to update the other tests</p>



<a name="130046005"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130046005" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130046005">(Jul 21 2018 at 08:57)</a>:</h4>
<p>should i remove <code>region-liveness-basic</code>, <code>region-liveness-two-disjoint-uses</code>, <code>region-subtyping-basic</code> or those are good to stay?</p>



<a name="130046190"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130046190" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130046190">(Jul 21 2018 at 09:02)</a>:</h4>
<p>hmm</p>



<a name="130046193"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130046193" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130046193">(Jul 21 2018 at 09:02)</a>:</h4>
<p>honestly we can probably just remove them</p>



<a name="130046195"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130046195" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130046195">(Jul 21 2018 at 09:02)</a>:</h4>
<p>I don't see them adding much value</p>



<a name="130046196"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130046196" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130046196">(Jul 21 2018 at 09:02)</a>:</h4>
<p>or update them</p>



<a name="130046198"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130046198" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130046198">(Jul 21 2018 at 09:02)</a>:</h4>
<p>I don't have a strong opinion :)</p>



<a name="130046204"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130046204" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130046204">(Jul 21 2018 at 09:02)</a>:</h4>
<p>meh maybe keep them</p>



<a name="130046205"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130046205" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130046205">(Jul 21 2018 at 09:02)</a>:</h4>
<p>do you know how to update them?</p>



<a name="130046224"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130046224" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130046224">(Jul 21 2018 at 09:03)</a>:</h4>
<p>nah i haven't updated earlier. i'll just keep them as is i guess :D</p>



<a name="130046280"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130046280" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130046280">(Jul 21 2018 at 09:05)</a>:</h4>
<p>well if they are passing, that's fine</p>



<a name="130046285"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130046285" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130046285">(Jul 21 2018 at 09:05)</a>:</h4>
<p>but otherwise, there are some comments at the end of the test</p>



<a name="130046289"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130046289" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130046289">(Jul 21 2018 at 09:05)</a>:</h4>
<p>these tests basically compare MIR output</p>



<a name="130046292"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130046292" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130046292">(Jul 21 2018 at 09:05)</a>:</h4>
<p>so the comments have to be edited to match the current output</p>



<a name="130051127"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130051127" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130051127">(Jul 21 2018 at 11:43)</a>:</h4>
<p>is there any convention for mod docblocks? I don't see any docblocs in other files.. <code>//!</code> or <code>`///</code>?</p>



<a name="130051182"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130051182" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130051182">(Jul 21 2018 at 11:44)</a>:</h4>
<p>//!</p>



<a name="130051183"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130051183" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130051183">(Jul 21 2018 at 11:44)</a>:</h4>
<p>you could also put those comments on some struct</p>



<a name="130051199"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130051199" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130051199">(Jul 21 2018 at 11:45)</a>:</h4>
<p>i have //! on the mod docs and /// for structs, impls, fns</p>



<a name="130051252"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130051252" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130051252">(Jul 21 2018 at 11:47)</a>:</h4>
<p>right</p>



<a name="130051523"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130051523" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130051523">(Jul 21 2018 at 11:55)</a>:</h4>
<p>pushed <span class="emoji emoji-1f44d" title="+1">:+1:</span></p>



<a name="130054343"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130054343" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130054343">(Jul 21 2018 at 13:14)</a>:</h4>
<p><span class="user-mention" data-user-id="120823">@DPC</span> so we get this test failure still (just 1):</p>
<div class="codehilite"><pre><span></span>[00:55:52] ---- [mir-opt] mir-opt/nll/region-liveness-basic.rs stdout ----
[00:55:52] ---- [mir-opt] mir-opt/nll/region-liveness-basic.rs stdout ----
[00:55:52] thread &#39;[mir-opt] mir-opt/nll/region-liveness-basic.rs&#39; panicked at &#39;Did not find expected line, error: Mismatch in lines
[00:55:52] Current block: None
[00:55:52] Actual Line: &quot;                                         | Live variables on entry to bb2[0]: []&quot;
[00:55:52] Expected Line: &quot;           | Live variables on entry to bb2[0]: [_1, _3]&quot;
[00:55:52] Test Name: rustc.main.nll.0.mir
[00:55:52] Expected:
[00:55:52] ... (elided)
[00:55:52]    bb2: {
[00:55:52]            | Live variables on entry to bb2[0]: [_1, _3]
[00:55:52]        _2 = &amp;&#39;_#2r _1[_3];
[00:55:52]            | Live variables on entry to bb2[1]: [_2]
[00:55:52]        switchInt(const true) -&gt; [false: bb4, otherwise: bb3];
[00:55:52]            | Live variables on exit from bb2: [_2]
[00:55:52] Actual:
[00:55:52] | Free Region Mapping
</pre></div>


<p>I would say either delete that test -- honestly, I think that's fine -- or else update it...</p>



<a name="130054345"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130054345" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130054345">(Jul 21 2018 at 13:14)</a>:</h4>
<p>Wrong topic?</p>



<a name="130054347"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130054347" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130054347">(Jul 21 2018 at 13:14)</a>:</h4>
<p>oops</p>



<a name="130054351"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130054351" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130054351">(Jul 21 2018 at 13:15)</a>:</h4>
<p>sure will delete it</p>



<a name="130054360"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130054360" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130054360">(Jul 21 2018 at 13:15)</a>:</h4>
<p>(yep, wrong topic, I moved to other thread)</p>



<a name="130054431"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130054431" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130054431">(Jul 21 2018 at 13:17)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> Pushed the <code>is_upvar_field_projection</code> fix.</p>



<a name="130054478"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130054478" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130054478">(Jul 21 2018 at 13:18)</a>:</h4>
<p>Do you have any thoughts on supporting the <code>issue-7573</code> case?</p>



<a name="130054493"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130054493" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130054493">(Jul 21 2018 at 13:19)</a>:</h4>
<p>I ended up creating a function to determine if something is what the user thinks is an upvar in <a href="https://github.com/rust-lang/rust/pull/52405" target="_blank" title="https://github.com/rust-lang/rust/pull/52405">https://github.com/rust-lang/rust/pull/52405</a></p>



<a name="130054548"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130054548" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130054548">(Jul 21 2018 at 13:20)</a>:</h4>
<p><span class="user-mention" data-user-id="116107">@David Wood</span> I <em>think</em> that if we examine the regions (and their categorizations) for which we are reporting the error, we ought to be able to handle <code>issue-7573</code></p>



<a name="130054550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130054550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130054550">(Jul 21 2018 at 13:20)</a>:</h4>
<p>I've been doing a local build though so I can inspect the debug output</p>



<a name="130054551"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130054551" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130054551">(Jul 21 2018 at 13:20)</a>:</h4>
<p>it's just taking forever</p>



<a name="130054563"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130054563" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130054563">(Jul 21 2018 at 13:21)</a>:</h4>
<p><span class="user-mention" data-user-id="116118">@Matthew Jasper</span> ah, interesting. which fn is that? I just r+'d that PR again btw, this time p=1</p>



<a name="130054564"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130054564" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130054564">(Jul 21 2018 at 13:21)</a>:</h4>
<p>time to get some of this NLL work landed dang it</p>



<a name="130054631"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130054631" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130054631">(Jul 21 2018 at 13:23)</a>:</h4>
<p>I was trying to work out how I'd check if a region was external or internal but couldn't see it anywhere.</p>



<a name="130054758"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130054758" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130054758">(Jul 21 2018 at 13:27)</a>:</h4>
<p><code>universal_regions</code> has some methods for that</p>



<a name="130054799"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130054799" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130054799">(Jul 21 2018 at 13:28)</a>:</h4>
<p>e.g., <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/borrow_check/nll/universal_regions/struct.UniversalRegions.html?search=#method.is_local_free_region" target="_blank" title="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/borrow_check/nll/universal_regions/struct.UniversalRegions.html?search=#method.is_local_free_region"><code>is_local_free_region</code></a></p>



<a name="130054807"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130054807" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130054807">(Jul 21 2018 at 13:28)</a>:</h4>
<p>Ah, great, not sure why I overlooked that.</p>



<a name="130054808"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130054808" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130054808">(Jul 21 2018 at 13:28)</a>:</h4>
<p>or, more generally, <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/borrow_check/nll/universal_regions/struct.UniversalRegions.html?search=#method.region_classification" target="_blank" title="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/borrow_check/nll/universal_regions/struct.UniversalRegions.html?search=#method.region_classification"><code>region_classification</code></a></p>



<a name="130054812"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130054812" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130054812">(Jul 21 2018 at 13:28)</a>:</h4>
<p>your branch is still building LLVM :( :(</p>



<a name="130055195"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130055195" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130055195">(Jul 21 2018 at 13:43)</a>:</h4>
<p>I've got it to correctly classify the <code>issue-7573.rs</code> case now.</p>



<a name="130055335"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130055335" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130055335">(Jul 21 2018 at 13:48)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> </p>
<div class="codehilite"><pre><span></span>error: borrowed data escapes outside of closure
  --&gt; src/test/ui/borrowck/issue-7573.rs:32:9
   |
27 |     let mut lines_to_use: Vec&lt;&amp;CrateId&gt; = Vec::new();
   |         ---------------- `lines_to_use` is declared here, outside of the closure body
28 |         //~^ NOTE cannot infer an appropriate lifetime
29 |     let push_id = |installed_id: &amp;CrateId| {
   |                    ------------ `installed_id` is a reference that is only valid in the closure body
...
32 |         lines_to_use.push(installed_id);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `installed_id` escapes the closure body here

error: aborting due to previous error
</pre></div>



<a name="130055344"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130055344" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130055344">(Jul 21 2018 at 13:49)</a>:</h4>
<p>Still doesn't do anything for the <code>E0621-does-not-trigger-for-closures.rs</code> case that was in <span class="user-mention" data-user-id="116083">@pnkfelix</span>'s list in the issue.</p>



<a name="130055386"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130055386" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130055386">(Jul 21 2018 at 13:50)</a>:</h4>
<p>Running tests then I'll push that change.</p>



<a name="130055592"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130055592" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130055592">(Jul 21 2018 at 13:58)</a>:</h4>
<p><span class="user-mention" data-user-id="116107">@David Wood</span> that is <em>awesome</em></p>



<a name="130055595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130055595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130055595">(Jul 21 2018 at 13:58)</a>:</h4>
<p>However, there are other tests that it is updating the errors for, and some run into ICEs.</p>



<a name="130055601"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130055601" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130055601">(Jul 21 2018 at 13:59)</a>:</h4>
<p>Seems related to what you were nervous about in the review.</p>



<a name="130055603"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130055603" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130055603">(Jul 21 2018 at 13:59)</a>:</h4>
<p>It's struggling to find variable names for some stuff.</p>



<a name="130055604"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130055604" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130055604">(Jul 21 2018 at 13:59)</a>:</h4>
<p>example?</p>



<a name="130055651"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130055651" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130055651">(Jul 21 2018 at 14:01)</a>:</h4>
<p>Three function is borriw_check:: mutability_errors::is_upvar, it will have to be moved if it's more generally useful.</p>



<a name="130055656"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130055656" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130055656">(Jul 21 2018 at 14:01)</a>:</h4>
<p>The function</p>



<a name="130055657"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130055657" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130055657">(Jul 21 2018 at 14:01)</a>:</h4>
<p>Well, some of them have nicer messages but the spans aren't fantastic:</p>
<div class="codehilite"><pre><span></span>error: borrowed data escapes outside of closure
  --&gt; src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs:33:20
   |
31 |     foo(cell, |cell_a, cell_x| {
   |                ------  ------ `cell_x` is a reference that is only valid in the closure body
   |                |
   |                `cell_a` is declared here, outside of the closure body
32 |         //~^ WARNING not reporting region error due to nll
33 |         cell_a.set(cell_x.get()); // forces &#39;x: &#39;a, error in closure
   |                    ^^^^^^^^^^^^ `cell_x` escapes the closure body here
</pre></div>



<a name="130055659"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130055659" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130055659">(Jul 21 2018 at 14:01)</a>:</h4>
<p>And some just fail:</p>
<div class="codehilite"><pre><span></span>error: internal compiler error: librustc_mir/borrow_check/nll/region_infer/error_reporting/var_name.rs:40: can&#39;t find var name for free region &#39;_#1r
  --&gt; src/test/ui/nll/issue-48238.rs:21:5
   |
21 |     move || use_val(&amp;orig); //~ ERROR
   |     ^^^^^^^^^^^^^^^^^^^^^^

thread &#39;rustc&#39; panicked at &#39;Box&lt;Any&gt;&#39;, librustc_errors/lib.rs:502:9
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
   1: std::sys_common::backtrace::print
   2: std::panicking::default_hook::{{closure}}
   3: std::panicking::default_hook
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
   6: std::panicking::begin_panic
   7: rustc_errors::Handler::span_bug
   8: rustc::session::opt_span_bug_fmt::{{closure}}
   9: rustc::ty::context::tls::with_opt::{{closure}}
  10: rustc::ty::context::tls::with_context_opt
  11: rustc::ty::context::tls::with_opt
  12: rustc::session::opt_span_bug_fmt
  13: rustc::session::span_bug_fmt
  14: rustc_mir::borrow_check::nll::region_infer::error_reporting::var_name::&lt;impl rustc_mir::borrow_check::nll::region_infer::RegionInferenceContext&lt;&#39;tcx&gt;&gt;::get_var_name_and_span_for_region::{{closure}}
  15: rustc_mir::borrow_check::nll::region_infer::error_reporting::var_name::&lt;impl rustc_mir::borrow_check::nll::region_infer::RegionInferenceContext&lt;&#39;tcx&gt;&gt;::get_var_name_and_span_for_region
  16: rustc_mir::borrow_check::nll::region_infer::RegionInferenceContext::solve_inner
</pre></div>



<a name="130055698"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130055698" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130055698">(Jul 21 2018 at 14:02)</a>:</h4>
<p><span class="user-mention" data-user-id="116107">@David Wood</span> it seems like <code>cell_a</code> the problem is more the <em>label</em> than the span</p>



<a name="130055699"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130055699" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130055699">(Jul 21 2018 at 14:02)</a>:</h4>
<p>but that last one is I think the problem I was pointing out, yes</p>



<a name="130055702"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130055702" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130055702">(Jul 21 2018 at 14:02)</a>:</h4>
<p>I suspect we can address that, too, by being careful with labels</p>



<a name="130055706"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130055706" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130055706">(Jul 21 2018 at 14:03)</a>:</h4>
<p>I'll push this change anyway since it does address more cases and then we can work on fixing the regressions from this commit.</p>



<a name="130055713"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130055713" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130055713">(Jul 21 2018 at 14:03)</a>:</h4>
<p>yeah</p>



<a name="130055759"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130055759" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130055759">(Jul 21 2018 at 14:05)</a>:</h4>
<p>Is the fix for this just having it return <code>Option&lt;(Option&lt;Symbol&gt;, Span)&gt;</code> and then adding some cases to the labels for when we couldn't find a name?</p>



<a name="130055853"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130055853" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130055853">(Jul 21 2018 at 14:08)</a>:</h4>
<p>well, maybe... the thing is, we <em>can</em> find the "thing that needs highlighting" (the return type) but it just doesn't have a <em>name</em></p>



<a name="130055856"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130055856" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130055856">(Jul 21 2018 at 14:08)</a>:</h4>
<p>so either we return <code>None</code> there, yes, and have some fallback</p>



<a name="130055860"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130055860" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130055860">(Jul 21 2018 at 14:08)</a>:</h4>
<p>or maybe we can change the interface to be a bit more generic?</p>



<a name="130055861"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130055861" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130055861">(Jul 21 2018 at 14:08)</a>:</h4>
<p>let's start with what we want the error messages to be, I think</p>



<a name="130055862"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130055862" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130055862">(Jul 21 2018 at 14:08)</a>:</h4>
<p>and go from there</p>



<a name="130055872"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130055872" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130055872">(Jul 21 2018 at 14:09)</a>:</h4>
<p>Well, we wouldn't know the span either? Since we get that from the upvar/argument index and that must be where the <code>None</code> is starting from for it to error where it is.</p>



<a name="130055874"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130055874" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130055874">(Jul 21 2018 at 14:09)</a>:</h4>
<p>e.g., in that first case you mentioned, I think maybe something like</p>
<div class="codehilite"><pre><span></span>error: borrowed data escapes outside of closure
  --&gt; src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs:33:20
   |
31 |     foo(cell, |cell_a, cell_x| {
   |                ------  ------ `cell_x` is a reference that is only valid in the closure body
   |                |
   |                XXX
32 |         //~^ WARNING not reporting region error due to nll
33 |         cell_a.set(cell_x.get()); // forces &#39;x: &#39;a, error in closure
   |                    ^^^^^^^^^^^^ `cell_x` escapes the closure body here
</pre></div>


<p>what should XXX be?</p>



<a name="130055878"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130055878" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130055878">(Jul 21 2018 at 14:09)</a>:</h4>
<p>it seems like it'd be useful <em>there</em> to maybe print the fully elaborated type</p>



<a name="130055922"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130055922" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130055922">(Jul 21 2018 at 14:10)</a>:</h4>
<p>e.g., "cell_a here has type <code>Vec&lt;&amp;'1 u32&gt;</code>, where <code>'1</code> is some lifetime outside the closure body"</p>



<a name="130055928"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130055928" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130055928">(Jul 21 2018 at 14:10)</a>:</h4>
<p>I'm not sure, coming up with error messages or documentation comments isn't my forte.</p>



<a name="130055932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130055932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130055932">(Jul 21 2018 at 14:10)</a>:</h4>
<p>one thing that makes me mildly nervous with the current style is that e.g. <code>cell_x</code> here has a type like <code>Cell&lt;&amp;u32&gt;</code></p>



<a name="130055934"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130055934" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130055934">(Jul 21 2018 at 14:11)</a>:</h4>
<p>so saying that it "is" a reference feels a <em>bit</em> wrong</p>



<a name="130055942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130055942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130055942">(Jul 21 2018 at 14:11)</a>:</h4>
<p>I could imagine something like:</p>



<a name="130055946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130055946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> csmoe <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130055946">(Jul 21 2018 at 14:11)</a>:</h4>
<p>fully elaborated type issue <br>
<a href="https://github.com/rust-lang/rust/issues/52533" target="_blank" title="https://github.com/rust-lang/rust/issues/52533">https://github.com/rust-lang/rust/issues/52533</a></p>



<a name="130056038"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130056038" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130056038">(Jul 21 2018 at 14:14)</a>:</h4>
<div class="codehilite"><pre><span></span>error: borrowed data escapes outside of closure
  --&gt; src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.rs:33:20
   |
31 |     foo(cell, |cell_a, cell_x| {
   |                ------  ------ `cell_x` has type `&amp;&#39;2 u32`, where `&#39;2` is only valid in the closure body
   |                |
   |                `cell_a` has type `Vec&lt;&amp;&#39;1 u32&gt;`, where `&#39;1` outlives the closure body
32 |         //~^ WARNING not reporting region error due to nll
33 |         cell_a.set(cell_x.get()); // forces &#39;x: &#39;a, error in closure
   |                    ^^^^^^^^^^^^ data with lifetime `&#39;2` escapes the closure body here
</pre></div>



<a name="130056085"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130056085" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130056085">(Jul 21 2018 at 14:14)</a>:</h4>
<p><span class="user-mention" data-user-id="116107">@David Wood</span> one option for <em>this</em> PR, if you like, is to put off some of these cases, just make it not ICE and we can revisit :)</p>



<a name="130056097"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130056097" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130056097">(Jul 21 2018 at 14:14)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> should I delete <code>region-liveness-two-disjoint-uses</code> as well?</p>



<a name="130056114"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130056114" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130056114">(Jul 21 2018 at 14:15)</a>:</h4>
<p>that said, if we were taking the approach I suggested with the <code>Cell</code> above, the return value case might then be something like:</p>
<div class="codehilite"><pre><span></span>error: internal compiler error: librustc_mir/borrow_check/nll/region_infer/error_reporting/var_name.rs:40: can&#39;t find var name for free region &#39;_#1r
  --&gt; src/test/ui/nll/issue-48238.rs:21:5
   |
21 |     move || use_val(&amp;orig); //~ ERROR
   |          ^^ the return type is `&amp;&#39;1 u32`, where `&#39;1` outlives the closure body
</pre></div>



<a name="130056120"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130056120" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130056120">(Jul 21 2018 at 14:15)</a>:</h4>
<p><span class="user-mention" data-user-id="120823">@DPC</span> yes what the heck, do it :)</p>



<a name="130056127"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130056127" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130056127">(Jul 21 2018 at 14:15)</a>:</h4>
<p>:D</p>



<a name="130056128"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130056128" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130056128">(Jul 21 2018 at 14:15)</a>:</h4>
<p>sorry, gotta get a better template for that second one :)</p>



<a name="130056177"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130056177" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130056177">(Jul 21 2018 at 14:16)</a>:</h4>
<p>I'm not sure. On the one hand I'd be nice to get it landed for the cases it does handle well. On the other hand, I'm not sure how to cleanly separate out the failing cases to fallback to something else.</p>



<a name="130057390"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130057390" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130057390">(Jul 21 2018 at 14:46)</a>:</h4>
<p>yeah, true, I was wondering that</p>



<a name="130057396"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130057396" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130057396">(Jul 21 2018 at 14:46)</a>:</h4>
<p>certainly for the ICE-like cases we could detect when there is no variable/upvar and return <code>None</code> back</p>



<a name="130057486"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130057486" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130057486">(Jul 21 2018 at 14:49)</a>:</h4>
<p>I've got it so that nothing ICEs. There are a handful of not-fantastic cases with this change, but all improvements over what was there previously and nothing that is show-stopper enough for this PR, I reckon.</p>



<a name="130057552"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130057552" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130057552">(Jul 21 2018 at 14:51)</a>:</h4>
<p>Pushed that.</p>



<a name="130057580"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130057580" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130057580">(Jul 21 2018 at 14:52)</a>:</h4>
<p>I agree with your assessment =)</p>



<a name="130058041"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130058041" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130058041">(Jul 21 2018 at 15:02)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> what about the <code>error-codes/E0621-does-not-trigger-for-closures.rs </code>case mentioned in the original issue?</p>



<a name="130058441"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130058441" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130058441">(Jul 21 2018 at 15:13)</a>:</h4>
<p>uh...</p>



<a name="130058501"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130058501" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130058501">(Jul 21 2018 at 15:14)</a>:</h4>
<p>what error does your branch get?</p>



<a name="130058509"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130058509" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130058509">(Jul 21 2018 at 15:15)</a>:</h4>
<p>For what?</p>



<a name="130058517"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130058517" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130058517">(Jul 21 2018 at 15:15)</a>:</h4>
<p>Oh.</p>



<a name="130058519"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130058519" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130058519">(Jul 21 2018 at 15:15)</a>:</h4>
<p>Forgot I sent a message.</p>



<a name="130058530"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130058530" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130058530">(Jul 21 2018 at 15:15)</a>:</h4>
<p>My branch doesn't change it at all AFAIK.</p>



<a name="130058573"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130058573" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130058573">(Jul 21 2018 at 15:16)</a>:</h4>
<p>oh, is that your concern?</p>



<a name="130058574"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130058574" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130058574">(Jul 21 2018 at 15:16)</a>:</h4>
<p>it doesn't seem to have a particularly nice error</p>



<a name="130058575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130058575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130058575">(Jul 21 2018 at 15:16)</a>:</h4>
<p>in the AST land either</p>



<a name="130058577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130058577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130058577">(Jul 21 2018 at 15:16)</a>:</h4>
<p>in fact it is sort of testing that you don't get a nice error:)</p>



<a name="130058595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130058595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130058595">(Jul 21 2018 at 15:17)</a>:</h4>
<p>Yeah, I expected to see a change given that it was listed as one of the tests affected in the issue.</p>



<a name="130058645"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130058645" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130058645">(Jul 21 2018 at 15:18)</a>:</h4>
<p>let me take a closer look, it seems like it <em>could</em> trigger</p>



<a name="130058712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130058712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130058712">(Jul 21 2018 at 15:20)</a>:</h4>
<p>I reckon either way it's probably a issue for another PR, but curious nonetheless.</p>



<a name="130063793"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130063793" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130063793">(Jul 21 2018 at 17:46)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> if you're happy with that PR, it's passed the tests now, could <code>r+</code> and get it into the queue. <span class="emoji emoji-1f603" title="smiley">:smiley:</span></p>



<a name="130063801"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130063801" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130063801">(Jul 21 2018 at 17:46)</a>:</h4>
<p>(I wish we had a general compiler/lang stream in Zulip for the RFC 2008 stuff)</p>



<a name="130096214"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130096214" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130096214">(Jul 22 2018 at 12:33)</a>:</h4>
<p>I guess we can make on :)</p>



<a name="130096260"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130096260" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130096260">(Jul 22 2018 at 12:34)</a>:</h4>
<p><span class="user-mention" data-user-id="120823">@DPC</span> PR landed, nice!</p>



<a name="130096331"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130096331" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130096331">(Jul 22 2018 at 12:37)</a>:</h4>
<p>yah i saw it  <span class="emoji emoji-1f603" title="smiley">:smiley:</span></p>



<a name="130096375"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130096375" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130096375">(Jul 22 2018 at 12:38)</a>:</h4>
<p>thanks for the mentoring <span class="emoji emoji-1f44d" title="+1">:+1:</span></p>



<a name="130096387"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130096387" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130096387">(Jul 22 2018 at 12:39)</a>:</h4>
<p>you up for more? :)</p>



<a name="130096393"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130096393" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130096393">(Jul 22 2018 at 12:39)</a>:</h4>
<p>maybe after a week</p>



<a name="130096433"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130096433" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130096433">(Jul 22 2018 at 12:40)</a>:</h4>
<p>sounds good</p>



<a name="130096439"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130096439" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130096439">(Jul 22 2018 at 12:40)</a>:</h4>
<p>I just realized I was the one in the wrong topic all of yesterday, oops, sorry.</p>



<a name="130096446"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions/near/130096446" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-52034-liveness-only-for-things-with-regions.html#130096446">(Jul 22 2018 at 12:40)</a>:</h4>
<p>haha.. <span class="user-mention" data-user-id="116107">@David Wood</span> i saw it but didn't want to interrupt.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>